
const state={
	isLogin:false,
	currentUser:null,
}
const getters={
	isLogin(state){
				return	state.isLogin
				},
	currentUser(state){
			 console.log(state.currentUser)
					return	state.currentUser
					}
				
}
const mutations={
userStatus(state,user){
	console.log(state)
					if(user){
						console.log(user)
						state.currentUser=user
						console.log(state.currentUser)
						state.isLogin=true
					}else{
						state.currentUser=null
						state.isLogin=false
					}
					}
}
const actions={
	setUser({commit},user){
					
					commit("userStatus",user)
				}
}

export default{
	state,
	getters,
	mutations,
	actions
}